<!-- <!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head> -->
	<!DOCTYPE html>
	<html lang="en" class="no-ie" style="overflow:hidden;">
		<head>
			<meta charset="UTF-8">
			<title>JCR期刊区间文献分布数</title>
			<script>
				"object" != typeof ue || "object" != typeof ue.interface ? ("object" != typeof ue && (ue = {}), ue.interface = {},
					ue.interface.broadcast = function(e, t) {
						if ("string" == typeof e) {
							var o = [e, ""];
							void 0 !== t && (o[1] = t);
							var n = encodeURIComponent(JSON.stringify(o));
							"object" == typeof history && "function" == typeof history.pushState ? (history.pushState({}, "",
								"#" + n), history.pushState({}, "", "#" + encodeURIComponent("[]"))) : (document.location
								.hash = n, document.location.hash = encodeURIComponent("[]"))
						}
					}) : function(e) {
					ue.interface = {}, ue.interface.broadcast = function(t, o) {
						"string" == typeof t && (void 0 !== o ? e.broadcast(t, JSON.stringify(o)) : e.broadcast(t, ""))
					}
				}(ue.interface), (ue4 = ue.interface.broadcast);
			</script>
			<script src="./dist/echarts.min.js"></script>
			<script src="./static/js/jquery.min.js"></script>
			<script src="./static/js/FuncTest.js"></script>
			<script src="./static/js/PortChart.js"></script>
			<script>
				$(function() {
					ue4("getSize", {
						mes: "get windows size"
					});
					ue4("getColor", {
						mes: "get all color"
					});
					ue4("getData", {
						mes: "get all data"
					});
					ue4("beginSize", {
						mes: BeginSize[0],
						mes2: BeginSize[1]
					});
					ue4("beginSizeY", {
						mes: BeginSize
					});
				});
				/*$(function () {
				    
				});*/
			</script>
			<style>
				* {
					margin: 0;
					padding: 0;
				}
				@font-face {
					font-family: 'SourceHanSansCN';
					src: url(./static/font/DIN-Medium.otf);
				}
			</style>
		</head>
		<body>
			<div id="main"></div>
			<!--
		dataTemp1: y轴数值;dataTemp2: x轴标题
		-->
			<script>
				let BeginSize = [418.48, 267.06];
				let myChart = null;
				let colorList=["rgba(0, 255, 255, 1)",'rgba(0, 185, 255, 1)','rgba(0, 136, 255, 1)','rgba(2, 77, 142, 1)']

				let itemTitle = ['1区期刊','2区期刊','3区期刊','4区期刊']

				let itemData = [108,208,308,408]
				// let dataList1 = []
				function fresh() {
					let dataList1 = []

					itemTitle.forEach((item,index)=>{
						dataList1.push({
							value: itemData[index],
							name: item,
							itemStyle: {
								color: colorList[index],
								borderWidth: 0
							},
							label: {
								position: index%2==0 ? 'right' : 'left',
								formatter: '{c}篇',
								color: 'rgba(223, 248, 255, 1)',
								fontWeight: 400,
								fontFamily: 'SourceHanSansCN',
								lineHeight: 19,
								fontSize: 15,
								padding: [0,0,0,5]
							},
							labelLine: {
								length: index<=1 ? 63 : 39,
								lineStyle: {
									color: 'rgba(158, 220, 246, 1)',
									type: 'dashed',
								}
							}
						})
					})
					if (myChart==null) {
						myChart = echarts.init(document.getElementById('main'));  //利用原型调取Echarts的初始化方法
					}
					let option = {
						backgroundColor: 'rgba(3, 16, 38, 1)',
						legend: {
							orient: 'horizontal',
							itemWidth: 9,
							itemHeight: 9,
							itemGap: 21,
							icon: 'circle',
							// align: "auto",
							bottom: 20,
							// top:'2',
							textStyle: {
								color: '#DFF8FF',
								fontSize: 15,
								lineHeight: 19,
								fontFamily: 'SourceHanSansCN',
								fontWeight: 400
							},
							data: itemTitle
						},
						series: [
						{
							name: 'Funnel',
							type: "funnel",
							left: 'center',
							bottom: 68,
							width: '40%',
							gap: 7,
							sort: 'ascending',
							data: dataList1,
							// maxsize: '80%'
						}
						]
					};
					myChart.setOption(option);
				}
				fresh();


				//浏览器测试用
				change(BeginSize[0], BeginSize[1]);

				function change(x, y) {
					let div = document.getElementById("main");
					//alert("I am an alert box!!");
					div.style.width = x + "px";
					div.style.height = y + "px";
					var myOption = myChart.getOption();
					myChart.resize();
					let types = []
					myOption.series.forEach((item) => {
						types.push(item.type)
					})
					return types
				}


				/************下面数据***********/
				ue.interface.TransList = function(data) {
					itemData = data;
					fresh();
				};
				ue.interface.TransList = function(data) {
					itemData1 = data;
					fresh();
				};
				ue.interface.TransList1 = function(data) {
					itemTitle = data;
					fresh();
				};

			</script>
		</body>
	</html>

	<!-- <body>
	</body>
</html> -->
